package org.smr.ministore.micro.client;

import java.util.List;

import org.blade.utils.Pager;
import org.smr.ministore.entities.Brand;
import org.smr.ministore.entities.vo.Assign2OrganVO;
import org.smr.ministore.entities.vo.Assign2OrgansVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient("Brand.Service")
public interface FeignBrandMicroServiceClient {

    @RequestMapping(method = RequestMethod.PUT, value = "/Brand/batchSave")
    int batchSave(@RequestBody List< Brand> entities);

    @RequestMapping(method = RequestMethod.POST, value = "/Brand/batchModify")
    int batchModify(@RequestBody List< Brand> entities);

    @RequestMapping(method = RequestMethod.PUT, value = "/Brand/save")
    public int save(@RequestBody Brand entity) ;

    @RequestMapping(method = RequestMethod.PATCH, value = "/Brand/updateById")
    public int updateById(@RequestBody Brand id);

    @RequestMapping(method = RequestMethod.GET, value = "/Brand/queryById/{id}")
    public  Brand queryById(@PathVariable("id")Long id);

    @RequestMapping(method = RequestMethod.DELETE, value = "/Brand/deleteById/{id}")
    public int deleteById(@PathVariable("id")Long id);

    @RequestMapping(method = RequestMethod.POST, value = "/Brand/paginate")
    public Pager<Brand> paginate( @RequestBody Brand entity, Long pageSize, Long pageNum);


    @ResponseBody
    @RequestMapping( method = RequestMethod.POST, value = "/BrandOrgan/assignToOrgans")
    public int assignToOrgans(@RequestBody Assign2OrgansVO assignee);


    @ResponseBody
    @RequestMapping( method = RequestMethod.POST, value = "/BrandOrgan/assign")
    public int assign(@RequestBody Assign2OrganVO sssign2Organ);

}
